package com.ruoyi.web.web.controller;

import com.ruoyi.web.core.config.AppConf;
import com.ruoyi.accountant.domain.Setting;
import com.ruoyi.accountant.service.SettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/***
 * 设置
 */
@Controller
@RequestMapping("/setting")
public class SettingController {


    @Autowired
    private SettingService settingService;

    @PostMapping("/saveOrUpdate")
    public String saveOrUpdate(Setting setting) {
        setting.setSid(AppConf.APP_SETTING_ID);
        settingService.saveOrUpdate(setting);
        return "redirect:/pages/admin/setting.html";
    }
}
